<template>
  <div v-if="show" class="error">{{ error }}</div>
</template>

<script>
  export default {
    props: {
      error: {
        type: String,
        default: '网络错误，请稍后重试'
      },
      show: {
        type: Boolean,
        default: false
      }
    }
  }
</script>

<style lang="less" scoped>
  .error {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, 0)
  }
</style>
